"use strict";
var imgs = document.querySelectorAll("img[data-lazyload]");
window.onscroll = base;
function base() {
    var windowHeight = document.documentElement.clientHeight;
    var scrollLength = document.documentElement.scrollTop;
    for (var i = 0; i < imgs.length; i++) {
        if (imgs[i].offsetTop < windowHeight + scrollLength) {
            imgs[i].src = imgs[i].dataset.base;
        }
    }
}
var LazyLoad = /** @class */ (function () {
    function LazyLoad(options) {
        this.domRoot = document.body;
        this.els = document.querySelectorAll("img[data-lazyload]") || [];
        this.imgLength = this.els.length;
    }
    LazyLoad.prototype.getImgLength = function () {
        return this.imgLength;
    };
    LazyLoad.prototype.calWindowHeight = function () {
        return document.documentElement.clientHeight;
    };
    LazyLoad.VERSION = '0.0.1';
    return LazyLoad;
}());
